<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'index.jsp' starting page</title>
    <link rel="stylesheet" href="css/bootstrap.css" type="text/css" />

  </head>
  
  <body style="margin-top:50px">
  

  
  <div class="container">
    <input type="button" value="类目树" id="totreeajax" class="btn btn-primary">
  <table>
  	<thead>
  		<th>操作</th>
		<th>ID</th>
		<th>资产编号</th>
		<th >资产名称</th>
		
		<th>资产类型</th>
		<th>资产状态</th>
		<th>是否外借</th>
		<th>是否可用</th>
		<th>数量</th>
		<th>批次</th>
		<th>单位</th>
		<th>存储时间</th>
		<th>购买时间</th>
		<th>借出天数</th>
		<th>工作室ID</th>
		<th>用户ID</th>
		<th>备注</th>
  	</thead>
  <tbody>
	    	<c:forEach items="${assetList}" var="assets">
	    	<tr>
	    		<td><a href="borrowAssepetitions?asseid=${assets.id }">预借</a><a href="editAssets?asseid=${assets.id }">编辑</a><a href="javascript:void(0)" rel="${assets.id }" class="shanchu">删除</a></td>
	    		<td>${assets.id }</td>
	    		<td>${assets.assetcode }</td>
	    		<td>${assets.assetname }</td>
	    		
	    		<td>${assets.assettype }</td>
	    		<td>${assets.assetstatus }</td>
	    		<td>${assets.isborrow }</td>
	    		<td>${assets.isvalidate }</td>
	    		<td>${assets.quantity }</td>
	    		<td>${assets.batch }</td>
	    		<td>${assets.unit }</td>
	    		<td>${assets.storedate }</td>
	    		<td>${assets.buydate }</td>
	    		<td>${assets.leavedays }</td>
	    		<td>${assets.room.id }</td>
	    		<td>${assets.user.id }</td>
	    		<td>${assets.assetmemo }</td>
	    	</tr>	
	    	</c:forEach>
    	</tbody>
  
  </table>
  
  <div class="modal hide fade in" id="removeModal" style="display: none;">
	    <div class="modal-header">
		    <button type="button" class="close" data-dismiss="modal">×</button>
		    <h3>系统提示</h3>
	    </div>
	    <div class="modal-body">
	    	<p>是否要删除该记录</p>
	    </div>
	    <div class="modal-footer">
		   <input type="button" class="btn unRemove" value="取消"/>
			<input type="button" class="btn btn-danger removeBtn" value="确定"/>
	    </div>
    </div>
  
  </div>
  
  
  	
  
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script type="text/javascript" src="js/bootstrap.min.js"></script>
  <script type="text/javascript">
	$(document).ready(function(){

		$("#totreeajax").click(function(){
				window.location.href="tree.action";
			});

		$(".shanchu").click(function(){
			removeId = $(this).attr("rel");
			$("#removeModal").modal("show");
		});
		$(".unRemove").click(function(){
			$("#removeModal").modal("hide");
		});
		$(".removeBtn").click(function(){
			window.location.href="deleteAssets?asseid="+removeId;
		});

		
	});
  
  </script>
  </body>
</html>
